<table class="admingrid" id="visithungary">
</table>
<button onclick="addVisitHungary()">Add visit link</button>
<button onclick="changeVisithungary()">Change visit link</button>
<button onclick="removeVisitHungary()">Remove visit link</button>

<script>
grids.visithungary = {
    url : generateServiceUrl({
        admin : true,
        service : "getlinkgroup",
        page : "static_content",
        params : {
            linkgroup : "visithungary"
        }
    }),
    colNames : [
        "href",
        "title"
    ],
    colModel : [
        { name : "href",   index : "href",   width : 350 },
        { name : "title",  index : "title",  width : 350 }
    ],
    caption : "visithungary",
    multiselect : true,
    multiboxonly : true,
    sortable : true
};

function changeVisithungary() {
    var id = getSelectedRow("visithungary");
    openAdminPopup("static_content", "changepopup", {
        title : "Change visit link"
    }, {
        groupname : "visithungary",
        id : id
    });
}

function reorder_visithungary(idlist) {
    callAdminService("static_content", "reorder", {
        idlist : idlist,
        groupname : "visithungary"
    }, {
        success : function() { }
    });
}

function addVisitHungary() {
    openAdminPopup("static_content", "addpopup", {
        title : "Adding new visit link"
    }, {
        groupname : "visithungary"
    });
}

function removeVisitHungary() {
    if (confirm("Are you sure to want to delete selected visit link?")) {
        var selectedItems = getSelectedRows("visithungary");
        callAdminService("static_content", "deletelinkfromgroup", {
            ids : selectedItems,
            groupname : "visithungary"
        }, {
            success : function(result) {
                refreshGrid("visithungary");
            }
        });
    }
}

</script>
